home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / rasshost.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  4.7 KB  |  163 lines

  1. /********************************************************************/
  2. /**               Copyright(c) 1989-1996 Microsoft Corporation.       **/
  3. /********************************************************************/
  4.  
  5. //***
  6. //
  7. // Filename:    rasshost.h
  8. //
  9. // Description: This header defines the interface between third party security
  10. //              DLLs and the RAS server.
  11. //
  12.  
  13. /*
  14.  *      C/C++ Run Time Library - Version 9.0
  15.  *
  16.  *      Copyright (c) 1997, 1998 by Borland International
  17.  *      All Rights Reserved.
  18.  *
  19.  */
  20.  
  21. #ifndef _RASSHOST_
  22. #define _RASSHOST_
  23. #pragma option push -b
  24.  
  25.  
  26. #include <rassapi.h>
  27.  
  28.  
  29. typedef DWORD  HPORT;
  30.  
  31. typedef struct _SECURITY_MESSAGE
  32. {
  33.     DWORD dwMsgId;
  34.  
  35.     HPORT hPort;
  36.  
  37.     DWORD dwError;                  // Should be non-zero only if error
  38.                                     // occurred during the security dialog.
  39.                                     // Should contain errors from winerror.h
  40.                                     // or raserror.h
  41.     CHAR  UserName[UNLEN+1];        // Should always contain username if
  42.                                     // dwMsgId is SUCCESS/FAILURE
  43.  
  44.     CHAR  Domain[DNLEN+1];          // Should always contain domain if
  45.                                     // dwMsgId is SUCCESS/FAILURE
  46.  
  47. } SECURITY_MESSAGE, *PSECURITY_MESSAGE;
  48.  
  49.  
  50. // Values for dwMsgId in SECURITY_MESSAGE structure
  51.  
  52. #define SECURITYMSG_SUCCESS     1
  53. #define SECURITYMSG_FAILURE     2
  54. #define SECURITYMSG_ERROR       3
  55.  
  56. // Used by RasSecurityGetInfo call
  57.  
  58. typedef struct _RAS_SECURITY_INFO
  59. {
  60.  
  61.     DWORD LastError;                    // SUCCESS = receive completed
  62.                                         // PENDING = receive pending
  63.                                         // else completed with error
  64.  
  65.     DWORD BytesReceived;                // only valid if LastError == SUCCESS
  66.  
  67.     CHAR  DeviceName[RASSAPI_MAX_DEVICE_NAME+1];
  68.  
  69.  
  70. }RAS_SECURITY_INFO,*PRAS_SECURITY_INFO;
  71.  
  72. typedef DWORD (WINAPI *RASSECURITYPROC)();
  73.  
  74. //
  75. // Called by third party DLL to notify the supervisor of termination of
  76. // the security dialog
  77. //
  78.  
  79. VOID WINAPI
  80. RasSecurityDialogComplete(
  81.     IN SECURITY_MESSAGE * pSecMsg       // Pointer to the above info. structure
  82. );
  83.  
  84. //
  85. // Called by supervisor into the security DLL to notify it to begin the
  86. // security dialog for a client.
  87. //
  88. // Should return errors from winerror.h or raserror.h
  89. //
  90.  
  91. DWORD WINAPI
  92. RasSecurityDialogBegin(
  93.     IN HPORT  hPort,        // RAS handle to port
  94.     IN PBYTE  pSendBuf,     // Pointer to the buffer used in
  95.                             // RasSecurityDialogSend
  96.     IN DWORD  SendBufSize,  // Size of above bufer in bytes
  97.     IN PBYTE  pRecvBuf,     // Pointer to the buffer used in
  98.                             // RasSecurityDialogReceive
  99.     IN DWORD  RecvBufSize,  // Size of above buffer
  100.     IN VOID  (WINAPI *RasSecurityDialogComplete)( SECURITY_MESSAGE* )
  101.                             // Pointer to function RasSecurityDialogComplete.
  102.                             // Guaranteed to be the same on every call.
  103. );
  104.  
  105. //
  106. // Called by supervisor into the security DLL to notify it to stop the
  107. // security dialog for a client. If this call returns an error, then it is not
  108. // neccesary for the dll to call RasSecurityDialogComplete. Otherwise the DLL
  109. // must call RasSecurityDialogComplete.
  110. //
  111. // Should return errors from winerror.h or raserror.h
  112. //
  113.  
  114. DWORD WINAPI
  115. RasSecurityDialogEnd(
  116.     IN HPORT    hPort           // RAS handle to port.
  117. );
  118.  
  119. //
  120. // The following entrypoints should be loaded by calling GetProcAddress from
  121. // RasMan.lib
  122. //
  123. // Called to send data to remote host
  124. // Will return errors from winerror.h or raserror.h
  125. //
  126.  
  127. DWORD WINAPI
  128. RasSecurityDialogSend(
  129.     IN HPORT    hPort,          // RAS handle to port.
  130.     IN PBYTE    pBuffer,        // Pointer to buffer containing data to send
  131.     IN WORD     BufferLength    // Length of above buffer.
  132. );
  133.  
  134. //
  135. // Called to receive data from remote host
  136. // Will return errors from winerror.h or raserror.h
  137. //
  138.  
  139. DWORD WINAPI
  140. RasSecurityDialogReceive(
  141.     IN HPORT    hPort,          // RAS handle to port.
  142.     IN PBYTE    pBuffer,        // Pointer to buffer to receive data
  143.     IN PWORD    pBufferLength,  // length of data received in bytes.
  144.     IN DWORD    Timeout,        // in seconds
  145.     IN HANDLE   hEvent          // Event to set when receive completes or
  146.                                 // timeouts
  147. );
  148.  
  149. //
  150. // Called to get Information about port.
  151. // Will return errors from winerror.h or raserror.h
  152. //
  153.  
  154. DWORD WINAPI
  155. RasSecurityDialogGetInfo(
  156.     IN HPORT                hPort,      // RAS handle to port.
  157.     IN RAS_SECURITY_INFO*   pBuffer     // Pointer to get info structure.
  158. );
  159.  
  160.  
  161. #pragma option pop
  162. #endif
  163.